import { Public } from '@app/common/decorators';
import { Body, Controller, Post } from '@nestjs/common';
import { ApiTags } from '@nestjs/swagger';

import { AuthService } from './auth.service';
import { AccessTokenDto } from './dto/accesstoken.dto';
import { AccountLoginDto } from './dto/auth.dto';

@ApiTags('Authorization')
@Controller('auth')
export class AuthController {
  constructor(private readonly authService: AuthService) {}

  @Public()
  @Post()
  async login(@Body() loginParam: AccountLoginDto): Promise<AccessTokenDto> {
    return this.authService.signIn(loginParam);
  }
}
